# 简单测试脚本来验证支付服务的修复
from src.services.payment_service import payment_service
from src.models.transaction import TransactionType, TransactionStatus
from decimal import Decimal

def test_payment_service_fix():
    print("开始验证支付服务修复...")
    
    # 1. 测试导入是否成功
    print("✅ 成功导入支付服务和相关模型")
    
    # 2. 测试枚举类型
    print(f"交易类型枚举: {[t.value for t in TransactionType]}")
    print(f"交易状态枚举: {[s.value for s in TransactionStatus]}")
    print("✅ 枚举类型验证成功")
    
    # 3. 测试创建支付订单函数（不实际执行数据库操作）
    try:
        # 使用None作为db参数，只测试函数签名和非数据库逻辑
        mock_db = None
        order = payment_service.create_payment_order(
            db=mock_db,
            user_id=1,
            amount=Decimal('100.00'),
            payment_method="wallet"
        )
        print(f"✅ 创建支付订单函数工作正常: {order['order_id']}")
    except Exception as e:
        print(f"❌ 创建支付订单函数测试失败: {str(e)}")
    
    print("\n验证完成！模型引用和枚举类型已修复。")

if __name__ == "__main__":
    test_payment_service_fix()